%%-----------------------------------------------------------------------%%
%%--- Applications ------------------------------------------------------%%

\chapter{Applications}


%%-----------------------------------------------------------------------%%
%%--- Applications of the integral to area ------------------------------%%

\section{Applications of the integral to area}

The development of calculus by Newton\index{Newton, Isaac} and
Leibniz\index{Leibniz, Gottfried Wilhelm} was a vital step in
the advancement of pure mathematics, but Newton also advanced the
applied sciences and mathematics. Not only did he discover theoretical
results, but he immediately used those results to answer important
applied questions about gravity and motion. The success of these
applications of mathematics to the physical sciences helped establish
what we now take for granted: mathematics can and should be used to
answer questions about the world. Newton applied mathematics to the
outstanding problems of his day, problems primarily in the field of
physics. In the intervening 300 years, thousands of people have
continued these theoretical and applied traditions and have used
mathematics to help develop our understanding of all of the physical
and biological sciences as well as the behavioral sciences and
business. Mathematics is still used to answer new questions in physics
and engineering, but it is also important for modeling ecological
processes, for understanding the behavior of DNA, for determining how
the brain works, and even for devising strategies for voting
effectively. The mathematics you are learning now can help you become
part of this tradition and you might even use it to add to our
understanding of different areas of life. It is important to
understand the successful applications of integration in case you need
to use those particular applications. It is also important that you
understand the process of building models with integrals so you can
apply it to new problems. Conceptually, converting an applied problem
to a Riemann sum is the most valuable and the most difficult step.


%%-----------------------------------------------------------------------%%
%%--- Using integration to determine areas ------------------------------%%

\subsection{Using integration to determine areas}
\index{area!by integration}

This section is about how to compute the area of fairly general
regions in the plane. Regions are often described as the area enclosed
by the graphs of several curves.  (``My land is the plot enclosed by
that river, that fence, and the highway.'')

Recall that the integral $\int_a^b f(x) \, dx$ has a geometric
interpretation as the signed area between the graph of $f(x)$ and the
$x$-axis. We defined area by subdividing, adding up approximate areas
(using points in the intervals) as \emph{Riemann sums}, and taking the
limit. Thus we defined area as a limit of Riemann sums. The Fundamental
Theorem of Calculus asserts that we can compute areas exactly when
we can find antiderivatives.

\begin{figure}[!htbp]
\centering
\includegraphics[height=4cm,width=8cm]{fig4-7-2.eps}
\caption{Area between $y=f(x)$ and $y=g(x)$.}
\label{fig:4-7-2}
\end{figure}

Instead of considering the area between the graph of $f(x)$ and the
$x$-axis, we consider more generally two graphs, $y = f(x)$ and $y =
g(x)$, and assume for simplicity that $f(x) \geq g(x)$ on an interval
$[a, b]$. Again, we approximate the area \emph{between} these two
curves as before using Riemann sums. Each approximating rectangle has
width $(b - a) / n$ and height $f(x) - g(x)$, so
\[
\text{Area bounded by graphs}
\approx
\sum \big[ f(c_i) - g(c_i) \big] \Delta x.
\]
Note that $f(x) - g(x) \geq 0$, so the area is nonnegative. From the
definition of integral we see that the exact area is
%
\begin{equation}
\label{eq:application:area_bounded_graphs}
\text{Area bounded by graphs}
=
\int_a^b \big( f(x) - g(x) \big) \, dx.
\end{equation}
%
Why did we make a big deal about approximations instead of just
writing down~(\ref{eq:application:area_bounded_graphs})? Because
having a sense of how this area comes directly from a Riemann sum is
very important. But what is the point of the Riemann sum if all we are
going to do is write down the integral? The sum embodies the geometric
manifestation of the integral. If you have this picture in your mind,
the Riemann sum has \emph{done its job}. If you understand this, you
are more likely to know what integral to write down; if you do not,
then you might not.

%(How to account for $g(x)$ or $f(x)$ under the $x$ axis.)
\begin{remark}
By the linearity property of integration, our sought for area is the
integral of the ``top'' function minus the integral of the ``bottom''
function, i.e.
\[
\int_a^b f(x) \, dx - \int_a^b g(x) \, dx.
\]
\end{remark}

\begin{figure}[!htbp]
\centering
\begin{tikzpicture}
[yscale=0.5,%
  linestyle/.style={semithick},%
  axisstyle/.style={semithick,->,>=stealth}]
% horizontal and vertical axes
\draw[axisstyle] (-2.5,0) -- (3.5,0) node[right]{$x$};
\draw[axisstyle] (0,-1.5) -- (0,10) node[above]{$y$};
% graph of functions
\draw[linestyle] plot[domain=-2:3] function{x + 1};
\draw[linestyle] plot[domain=-2:3] function{9 - x**2};
% tick marks on horizontal axis
\draw[linestyle] (-2,-0.2) -- (-2,0.2) node[above]{$-2$};
\draw[linestyle] (-1,-0.2) node[below]{$-1$} -- (-1,0.2);
\draw[linestyle] (1,-0.2) node[below]{1} -- (1,0.2);
\draw[linestyle] (2,-0.2) node[below]{2} -- (2,0.2);
\draw[linestyle] (3,-0.2) node[below]{3} -- (3,0.2);
% tick marks on vertical axis
\draw[linestyle] (-0.1,4) node[left]{4} -- (0.1,4);
\draw[linestyle] (-0.1,8) node[left]{8} -- (0.1,8);
% dash lines
\draw[linestyle,dash pattern=on 2pt off 2pt] (-1,0) -- (-1,8);
\draw[linestyle,dash pattern=on 2pt off 2pt] (2,0) -- (2,5);
\end{tikzpicture}
\caption{Plots of $y = x + 1$ and $y = 9 - x^2$.}
\label{fig:applications:area_bounded_parabola_linear}
\end{figure}

\begin{example}
\label{ex:applications:area_bounded_parabola_linear}
Find the area enclosed by $y = x + 1$, $y = 9 - x^2$, $x = -1$, and
$x = 2$~(see
Figure~\ref{fig:applications:area_bounded_parabola_linear}).
\end{example}

\begin{proof}[Solution]
The area can be expressed as
\[
\text{Area}
=
\int_{-1}^2 \big[ (9 - x^2) - (x + 1) \big] \, dx.
\]
We have reduced the problem to computing the integral
\[
\int_{-1}^2 \big[ (9 - x^2) - (x + 1) \big] \, dx
= \int_{-1}^2 (8 - x - x^2) \, dx
= \left[ 8x - \frac{1}{2} x^2 - \frac{1}{3} x^3 \right]_{-1}^2
= \frac{39}{2}.
\]
The computation can be done using the code
%
\begin{center}
\fontsize{10pt}{10pt}
\selectfont
\tt
\begin{lstlisting}
sage: P1 = plot(x + 1, x, -2, 3)
sage: P2 = plot(9 - x^2, x, -2, 3)
sage: T1 = text("$y = x + 1$", (1, 2.6))
sage: T2 = text("$y = 9 - x^2$", (2, 7))
sage: L1 = line2d([(-1,0), (-1,8)], linestyle=":")
sage: L2 = line2d([(2,0), (2,5)], linestyle=":")
sage: show(P1 + P2 + T1 + T2 + L1 + L2)
sage: integrate((9 - x^2) - (x + 1), x, -1, 2)
39/2
\end{lstlisting}
\end{center}
%
and the resulting plot is similar to that in
Figure~\ref{fig:applications:area_bounded_parabola_linear}.
\end{proof}

Example~\ref{ex:applications:area_bounded_parabola_linear} illustrates
a simple case. In practice, more interesting situations often arise.
The next example illustrates finding the boundary points $a$ and $b$
when they are not explicitly given.

\begin{figure}[!htbp]
\centering
\begin{tikzpicture}
[yscale=0.3,%
  linestyle/.style={semithick},%
  axisstyle/.style={semithick,->,>=stealth}]
% horizontal and vertical axes
\draw[axisstyle] (-4.5,0) -- (4.5,0) node[right]{$x$};
\draw[axisstyle] (0,-7) -- (0,13.5) node[above]{$y$};
% graph of functions
\draw[linestyle] plot[domain=-4:4] function{12 - x**2};
\draw[linestyle] plot[domain=-4:4] function{x**2 - 6};
% tick marks on horizontal axis
\draw[linestyle] (-4,-0.255) -- (-4,0.255) node[above]{$-4$};
\draw[linestyle] (-2,-0.255) -- (-2,0.255) node[above]{$-2$};
\draw[linestyle] (2,-0.255) -- (2,0.255) node[above]{2};
\draw[linestyle] (4,-0.255) -- (4,0.255) node[above]{4};
% tick marks on vertical axis
\draw[linestyle] (-0.1,-5) node[left]{$-5$} -- (0.1,-5);
\draw[linestyle] (-0.1,5) node[left]{5} -- (0.1,5);
\draw[linestyle] (-0.1,10) node[left]{10} -- (0.1,10);
\end{tikzpicture}
\caption{Plots of $y = 12 - x^2$ and $y = x^2 - 6$.}
\label{fig:applications:area_bounded_parabolas}
\end{figure}

\begin{example}
\label{ex:applications:area_bounded_parabolas}
Find the area enclosed by the two parabolas $y = 12 - x^2$ and
$y = x^2 - 6$.
\end{example}

\begin{proof}[Solution]
We are not given the boundary points $a$ and $b$. So we need to figure
that out. How? We must find \emph{exactly} where the two curves
intersect by setting the two curves equal and finding the solution. We
have
\[
x^2 - 6 = 12 - x^2
\]
so $0 = 2x^2 - 18 = 2(x^2 - 9) = 2(x - 3)(x + 3)$, hence the points of
intersection are at $a = -3$ and $b = 3$. The area can be computed as
\[
\int_{-3}^3 \left[ 12 - x^2 - (x^2 - 6) \right] \, dx
= \int_{-3}^3 (18 - 2x^2) \, dx
= 4 \int_0^3 (9 - x^2) \, dx
= 4 \cdot 18
= 72.
\]
The computation is performed as follows
%
\begin{center}
\fontsize{10pt}{10pt}
\selectfont
\tt
\begin{lstlisting}
sage: P1 = plot(12 - x^2, x, -5, 5)
sage: P2 = plot(x^2 - 6, x, -5, 5)
sage: T1 = text("$y = 12 - x^2$", (-3.5, -10))
sage: T2 = text("$y = x^2 - 6$", (2, -7))
sage: show(P1 + P2 + T1 + T2)
sage: integrate((12 - x^2) - (x^2 - 6), x, -3, 3)
72
\end{lstlisting}
\end{center}
%
and the resulting plot is similar to that in
Figure~\ref{fig:applications:area_bounded_parabolas}.
Of course, if we had mistakenly computed
$\int_{-3}^3 \left[ (x^2 - 6) - (12 - x^2) \right] \, dx$, then we
would have gotten $-72$ as an answer. However, always remember that
\emph{areas are nonnegative}, so the correct answer is $72$.
\end{proof}

\begin{figure}[!htbp]
\centering
\begin{tikzpicture}
[xscale=0.4,%
  yscale=0.8,%
  linestyle/.style={semithick},%
  axisstyle/.style={semithick,->,>=stealth}]
% horizontal and vertical axes
\draw[axisstyle] (-7,0) -- (13,0) node[right]{$x$};
\draw[axisstyle] (0,-4.5) -- (0,4.5) node[above]{$y$};
% tick marks on horizontal axis
\draw[linestyle] (-5,-0.1) node[below]{$-5$} -- (-5,0.1);
\draw[linestyle] (5,-0.1) node[below]{5} -- (5,0.1);
\draw[linestyle] (10,-0.1) node[below]{10} -- (10,0.1);
% tick marks on vertical axis
\draw[linestyle] (-0.2,-4) node[left]{$-4$} -- (0.2,-4);
\draw[linestyle] (-0.2,-2) node[left]{$-2$} -- (0.2,-2);
\draw[linestyle] (-0.2,2) node[left]{2} -- (0.2,2);
\draw[linestyle] (-0.2,4) node[left]{4} -- (0.2,4);
% graph of functions
\draw[linestyle,rotate=-90] plot[domain=-3.4641:3.4641] function{12 - x**2};
\draw[linestyle,rotate=-90] plot[domain=-4:4] function{x**2 - 6};
\end{tikzpicture}
\caption{Plots of $x=12-y^2$ and $x=y^2-6$.}
\label{fig:applications:area_bounded_parabolas_rotate}
\end{figure}

A common way in which we might be tested to see if we \emph{really}
understand what is going on, is to be asked to find the area between
two graphs $x = f(y)$ and $x = g(y)$. If the two graphs are vertical,
subtract off the right-most curve. Or, just ``switch $x$ and $y$''
everywhere (i.e. reflect about $y = x$). The area is unchanged.

For instance, consider the area between the two parabolas
$x = 12 - y^2$ and $x = y^2 - 6$. Swapping $x$ and $y$ amounts to
reflecting the plot in
Figure~\ref{fig:applications:area_bounded_parabolas_rotate} about the
$45^{\circ}$ line $y = x$. The reflected graph coincides with that in
Figure~\ref{fig:applications:area_bounded_parabolas} above. Therefore, by
Example~\ref{ex:applications:area_bounded_parabolas}, the answer is $72$.

\begin{figure}[!htbp]
\centering
\begin{tikzpicture}
[xscale=2,%
  linestyle/.style={semithick},%
  axisstyle/.style={semithick,->,>=stealth}]
% horizontal and vertical axes
\draw[axisstyle] (-1.25,0) -- (2.25,0) node[right]{$x$};
\draw[axisstyle] (0,-2.5) -- (0,4.5) node[above]{$y$};
% tick marks on horizontal axis
\draw[linestyle] (-1,-0.15) -- (-1,0.15) node[above]{$-1$};
\draw[linestyle] (1,-0.15) node[below]{1} -- (1,0.15);
\draw[linestyle] (2,-0.15) node[below]{2} -- (2,0.15);
% tick marks on vertical axis
\draw[linestyle] (-0.05,-2) node[left]{$-1$} -- (0.05,-2);
\draw[linestyle] (-0.05,2) node[left]{1} -- (0.05,2);
\draw[linestyle] (-0.05,4) node[left]{2} -- (0.05,4);
% graph of functions
\draw[linestyle] plot[domain=-1:2] function{2*sin(3.1415*x)};
\draw[linestyle] plot[domain=-1:2] function{2*(x**2 - x)};
% dash line
\draw[linestyle,dash pattern=on 2pt off 2pt] (2,0) -- (2,4);
\end{tikzpicture}
\caption{Plots of $y=\sin(\pi x)$ and $y=x^2-x$.}
\label{fig:applications:area_bounded_parabola_sin}
\end{figure}

\begin{example}
Find the area (\emph{not signed area!}) enclosed by
$y = \sin(\pi x)$, $y = x^2 - x$, and $x = 2$.
\end{example}

\begin{proof}[Solution]
Write $x^2 - x = (x - 1/2)^2 - 1/4$ so that we can obtain the graph of
the parabola by shifting the standard graph. The area comes in two
pieces, and the upper and lower curves switch in the middle. What we
are doing is integrating the \emph{absolute value} of the difference.
The area is
\[
\int_0^1 \sin(\pi x) - (x^2 - x) \, dx
-
\int_1^2 (x^2 - x) - \sin(\pi x) \, dx
=
\frac{4}{\pi} + 1
\]
The computation is as follows
%
\begin{center}
\fontsize{10pt}{10pt}
\selectfont
\tt
\begin{lstlisting}
sage: P1 = plot(sin(pi*x), x, -1, 2.2)
sage: P2 = plot(x^2 - x, x, -1, 2.2)
sage: P3 = list_plot([(2,0), (2,2)], plotjoined=True, linestyle=":")
sage: T1 = text("$y = \sin(\pi x)$", (-1.2,-1))
sage: T2 = text("$y = x^2 - x$", (1.3,1.3))
sage: show(P1 + P2 + P3 + T1 + T2)
sage: A = integrate(sin(pi*x) - (x^2 - x), x, 0, 1); A
1/6*(pi + 12)/pi
sage: B = integrate((x^2 - x) - sin(pi*x), x, 1, 2); B
1/6*(5*pi + 12)/pi
sage: expand(A + B)
4/pi + 1
\end{lstlisting}
\end{center}
%
and the resulting plot is similar to
Figure~\ref{fig:applications:area_bounded_parabola_sin}. Something to
take away from this is that in order to solve this sort of problem,
you need some facility with graphing functions. If you are not
comfortable with this, review.
\end{proof}


%%-----------------------------------------------------------------------%%
%%--- Computing volumes of surfaces of revolution -----------------------%%

\section{Computing volumes of surfaces of revolution}
\index{volume!by integration}
\index{surface of revolution}

The last section emphasized a geometric interpretation of definite
integrals as areas in two dimensions. This section emphasizes another
geometrical use of integration: calculating volumes of solid
three-dimensional objects, such as a volume of revolution. A basic
approach is to cut the whole solid into thin ``slices'' whose volumes
can be approximated, add the volumes of these ``slices'' together (a
Riemann sum), and finally obtain an exact answer by taking a limit of
the sums to get a definite integral.

\begin{practice}
Most people have a body density between $0.95$ and $1.05$ times the
density of water, which is $62.5$ pounds per cubic foot. Use your
weight (in lbs) to estimate the volume of your body (in cubic feet).
(If you float in fresh water, your body density is less than $1$.)
\end{practice}

First, we discuss the building blocks of this section: right solids.
A \emph{right solid} is a three-dimensional shape swept out by moving
a planar region $A$ some distance $h$ along a line perpendicular to the
plane of $A$. For instance, if $A$ is a rectangle, then the
right solid formed by moving $A$ along the line is a $3$-dimensional
solid box $B$ and, of course, the volume of $B$ is
\[
\text{area of A} \times \text{distance along the line}
=
\text{base} \times \text{height} \times \text{width}.
\]
The region $A$ is called a \emph{face} of the solid. The word
``right'' is simply used to indicate that the movement is along a line
perpendicular (at a right angle) to the plane of $A$. Two parallel
cuts though the shape produce a slice with two faces.

\begin{example}
Suppose there is a fine, uniform mist in the air and every cubic foot
of mist contains $0.02$ ounces of water droplets. If you run $50$ feet
in a straight line through this mist, how wet would you be? Assume that
the front (or a cross section) of your body has an area of $8$ square
feet.
\end{example}

\begin{proof}[Solution]
As you run, the front of your body sweeps out a ``tunnel'' through the
mist. The volume of the tunnel is the (cross sectional) area of the
front of your body multiplied by the length of the tunnel:
\[
\text{volume}
=
\text{$8$ ft} \times \text{$50$ ft}
=
\text{$400$ ft}.
\]
Since each cubic foot of mist held $0.02$ ounces of water which is
now on you, you swept out a total of ($400$ ft)($0.02$ oz/ft)
= $8$ ounces of water.
\end{proof}

A general solid can be cut into slices that are almost right
solids. An individual slice may not be exactly a right solid since its
cross sections may have different areas. However, if the cuts are
close together, the cross sectional areas will not change much within
a single slice. Each slice will be almost a right solid and its volume
will be almost the volume of a right solid.

Suppose an $x$-axis is positioned below the solid shape and let
$A(x)$ be the area of the face formed when the solid is cut at $x$
perpendicular to the $x$-axis. If
$P = \{ x_0=a, x_1, x_2, \dots , x_n = b \}$ is a partition of
$[a, b]$ and the solid is cut at each $x_i$, each slice of the solid
is almost a right solid and the volume of each slice is approximately
\[
\text{area of a face of the slice}
\times
\text{thickness of the slice}
\approx
A(x_i) \Delta x_i.
\]
The total volume $V$ of the solid is approximately the sum of the
volumes of the slices:
\[
V
=
\sum \text{volume of each slice}
\approx
\sum_i A(x_i) \Delta x_i
\]
which is a Riemann sum. The limit, as the mesh of the partition
approaches $0$ (taking thinner and thinner slices) of the Riemann sum
is the definite integral of $A(x$):
\[
V
\approx
\lim_{\mesh(P) \to 0} \sum_i A(x_i) \Delta x_i
=
\int_a^b A(x) \, dx.
\]

\begin{theorem}
\textbf{Volume by slices.}
\index{volume!by slices}
Let $S$ be a solid and $A(x)$ the area of the face formed by a cut at
$x$ and perpendicular to the $x$-axis. Then the volume $V$ of the
part of $S$ above the interval $[a, b]$ is $V = \int_a^b A(x) \, dx$.
\end{theorem}

Recall that the volume of a solid box is
\[
\text{volume}
=
\text{length} \times \text{width} \times \text{height}.
\]
More generally, the volume of cylinder is $V = \pi r^2 h$ (cross
sectional area times height). Even more generally, if the base of a
prism has area $A$, the volume of the prism is $V = Ah$.

But what if our solid object looks like a complicated blob? How would
we compute the volume?  We will do something that by now should seem
familiar, which is to chop the object into small pieces and take the
limit of approximations. If these small pieces are cross sections, then
the corresponding method of computing the volume of revolution is called
the \emph{disk method}. If these small pieces are cylindrical shells,
then the corresponding method of computing the volume of revolution is
called the \emph{shell method}. We look in detail into the disk method
first, followed by the shell method.


%%-----------------------------------------------------------------------%%
%%--- Disk method -------------------------------------------------------%%

\subsection{Disk method}
\index{volume!by disk method}

Assume that we have a function
\[
A(x)
=
\text{cross sectional area at $x$}.
\]
The volume of our potentially complicated blob is approximately
$\sum A(x_i) \Delta x_i$. Thus
%
\begin{align*}
\text{volume of blob}
&= \lim_{n \to \infty} \sum_{i=1}^n A(x_i) \Delta x_i \\
&= \int_a^b A(x) \, dx.
\end{align*}
%
%\begin{example}
%Here is how to plot a picture of solid sliced vertically into a bunch
%of vertical thin solid disks in \sage:
%
%\vskip .1in
%
%\begin{Verbatim}[fontsize=\scriptsize,fontfamily=courier,fontshape=tt,frame=single,label=\sage]
%
%sage: cone = lambda u,v: [cos(u)*v, sin(u)*v, 3/2-3*v/2]
%sage: p1 = parametric_plot3d(cone(u,v), (u, 0, 2*pi), (v, 0, 1.5), opacity = 0.5,plot_points=[20,20])
%sage: p2 = parametric_plot3d(cone(u,0.25), (u, 0, 2*pi), rgbcolor=(1,0,0))
%sage: p3 = parametric_plot3d(cone(u,0.5), (u, 0, 2*pi), rgbcolor=(1,0,0))
%sage: p4 = parametric_plot3d(cone(u,0.75), (u, 0, 2*pi), rgbcolor=(1,0,0))
%sage: p5 = parametric_plot3d(cone(u,1.0), (u, 0, 2*pi), rgbcolor=(1,0,0))
%sage: p6 = parametric_plot3d(cone(u,1.25), (u, 0, 2*pi), rgbcolor=(1,0,0))
%sage: show(p1+p2+p3+p4+p5+p6)
%
%\end{Verbatim}
%
Figure~\ref{fig:applications:volume_cone_shell_method} shows a plot of
a solid sliced vertically into a bunch of vertical thin solid disks.

\begin{figure}[!htbp]
\centering
\includegraphics[height=5cm,width=6cm]{graphs/sage-vol1.eps}
\quad
\includegraphics[height=5cm,width=6cm]{graphs/sage-vol2.eps}
\caption{Plot of the cone
  $z = \frac{3}{2} \big( 1-\sqrt{x^2 + y^2} \big)$ sliced into thin
  ``shells'', which are approximated by thin disks.}
\label{fig:applications:volume_cone_shell_method}
\end{figure}

\begin{example}
Find the volume of a pyramid with height $H$ and square base with
sides of length $L$.
\end{example}

\begin{proof}
For convenience, consider a pyramid on its side with the tip of the
pyramid at the origin. We need to figure out the cross sectional area
as a function of $x$, for $0 \leq x \leq H$. The function that gives
the distance $s(x)$ from the $x$-axis to the edge is a line, with
$s(0) = 0$ and $s(H) = L/2$. The equation of this line is thus
$s(x) = \frac{L}{2H} x$. Thus the cross sectional area is
\[
A(x)
=
\big( 2s(x) \big)^2
=
\frac{x^2 L^2}{H^2}.
\]
The volume is then
\[
\int_0^H A(x) \, dx
=
\int_0^H \frac{x^2 L^2}{H^2} \, dx
=
\left[ \frac{x^3 L^2}{3H^2} \right]_0^H
=
\frac{H^3 L^2}{3H^2}
\]
which simplifies to $\frac{1}{3} HL^2$.
\end{proof}

\begin{figure}[!htbp]
\centering
\includegraphics[height=5cm,width=8cm]{graphs/Gizah_Pyramids.eps}
\caption{How big is Pharaoh's place?. (Photo found on
\url{http://en.wikipedia.org/wiki/Egyptian_pyramids},
taken by Ricardo Liberato.)}
\label{fig:Gizah_Pyramids}
\end{figure}

When a region is revolved around a line (Figure~\ref{fig:5-1-24})
a right solid is formed. When the face of each slice of the revolved
region is a circle, then the formula for the area of the face is easy:
$A(x)$ = area of a circle = $\pi$(radius), where the radius is often a
function of the location $x$. Finding a formula for the changing
radius requires care.

\begin{figure}[!htbp]
\centering
\includegraphics[height=5cm,width=8cm]{graphs/fig5-1-24.eps}
\caption{Disk method for computing a volume of revolution.}
\label{fig:5-1-24}
\end{figure}

\begin{theorem}
\textbf{Volumes of revolved regions by disks.}
If the region formed between $f$, the horizontal line $y = L$,
and the interval $[a, b]$ is revolved about the horizontal
line $y = L$ (see Figure~\ref{fig:5-1-24}), then the volume is
$V = \int_a^b A(x) \, dx
= \int_a^b \pi \text{(radius)} \, dx
= \int_a^b \pi (f(x) - L) \, dx$.
\end{theorem}

\begin{figure}[!htbp]
\centering
\begin{tikzpicture}
[scale=3,%
  linestyle/.style={semithick},%
  axisstyle/.style={semithick,->,>=stealth}]
% horizontal and vertical axes
\draw[axisstyle] (-0.1,0) -- (1.2,0) node[right]{$x$};
\draw[axisstyle] (0,-0.1) -- (0,1.2) node[above]{$y$};
% tick marks
\draw[linestyle] (1,-0.05) node[below]{1} -- (1,0.05);
\draw[linestyle] (-0.05,1) node[left]{1} -- (0.05,1);
% graph of functions
\draw[linestyle] plot[domain=0:1] function{x**2};
\draw[linestyle] plot[domain=0:1] function{x**3};
\end{tikzpicture}
\caption{Plots of $y=x^2$ and $y=x^3$.}
\label{fig:applications:flowerplot_volume}
\end{figure}

\begin{example}
\label{ex:applications:flowerplot_volume}
Find the volume of the solid obtained by rotating the following
``flower pot'' region~(see
Figure~\ref{fig:applications:flowerplot_volume}) about the $x$ axis:
the region enclosed by $y = x^2$ and $y = x^3$ between $x = 0$ and
$x = 1$.
\end{example}

\begin{proof}[Solution]
The cross section is a ``washer'' and the area as a function
of $x$ is
\[
A(x)
=
\pi \big( r_{\text{out}}(x)^2 - r_{\text{in}}(x)^2 \big)
=
\pi (x^4 - x^6).
\]
The volume is thus
\[
\int_0^1 A(x) \, dx
= \int_0^1 \left( \frac{1}{5} x^5 - \frac{1}{7} x^7 \right) \, dx
= \pi \left[ \frac{1}{5} x^5 - \frac{1}{7} x^7 \right]_0^1
\]
which simplifies to $\frac{2}{35} \pi$.
\end{proof}

\begin{practice}
Find the volumes swept out when
%
\begin{itemize}
\item[(a)] the region between $f(x) = x$ and the $x$-axis, for
  $0 \leq x \leq 2$, is revolved about the $x$-axis; and

\item[(b)] the region between $f(x) = x$ and the line $y = 2^x$, for
  $0 \leq x \leq 2$, is revolved about the line $y = 2$.
\end{itemize}
\end{practice}

\begin{example}
\label{ex:spherevol}
One of the most important examples of a volume is the volume $V$
of a sphere of radius $r$. Let's find it!
\end{example}

\begin{proof}
We will just compute the volume of a half and multiply by $2$. The
cross sectional area is
\[
A(x)
=
\pi r(x)^2
=
\pi \left( \sqrt{r^2-x^2} \right)^2
=
\pi (r^2 - x^2).
\]
Then
\[
\frac{1}{2} V
=
\int_0^r \pi (r^2 - x^2) \, dx
=
\pi \left[ r^2 x - \frac{1}{3} x^3 \right]_0^r
=
\pi r^3 - \frac{1}{3} \pi r^3
=
\frac{2}{3} \pi r^3.
\]
Thus $V = (4/3) \pi r^3$.
\end{proof}

\begin{figure}[!htbp]
\centering
\includegraphics[height=3cm,width=5cm]{graphs/sage-vol3.eps}
\caption{Two intersecting spheres.}
\label{fig:sage-vol3}
\end{figure}

\begin{example}
Find the volume of intersection of two spheres of radius $r$, where
the center of each sphere lies on the edge of the other sphere.
\end{example}

\begin{proof}[Solution]
From Figure~\ref{fig:sage-vol3} we see that the answer is
\[
2 \int_{r/2}^r A(x) \, dx
\]
where $A(x)$ is \emph{exactly} as in Example~\ref{ex:spherevol}. We
have
\[
2 \int_{r/2}^r \pi (r^2 - x^2) \, dx
=
\frac{5}{12} \pi r^3
\]
which is the desired volume.
\end{proof}

The previous ideas and techniques can also be used to find the volumes
of solids with holes in them. If $A(x)$ is the area of the face formed
by a cut at $x$, then it is still true that the volume is
$V = \int_a^b A(x) \, dx$. However, if the solid has holes, then some
of the faces will also have holes and a formula for $A(x)$ may be more
complicated. Sometimes it is easier to work with two integrals and
then subtract: (i)~calculate the volume $S$ of the solid
\emph{without} the hole; (ii)~calculate the volume $H$ of the hole;
and (iii)~subtract $H$ from $S$. This is what was done in
Example~\ref{ex:applications:flowerplot_volume}.


%%-----------------------------------------------------------------------%%
%%--- Shell method ------------------------------------------------------%%

\subsection{Shell method}
\index{volume!by shell method}

The disk method can be cumbersome if we want the volume when the
region in the figure is revolved about the $y$-axis or some other
vertical line. To revolve the region about the $y$-axis, the disk
method requires that we represent the original equation $y = f(x)$ as
a function of $y$, i.e. $x = g(y)$. Sometimes that is easy: if
$y = 3x$ then $x = y/3$. But sometimes it is not easy at all: if
$y = x + e^x$, then we cannot solve for $y$ as an ``elementary''
function of $x$. The shell method lets us use the original equation
$y = f(x)$ to find the volume when the region is revolved about a
vertical line. We partition the $x$-axis to cut the region into thin,
almost rectangular slices. When the thin slice at $x_i$ is revolved
about the $y$-axis~(see Figure~\ref{fig:5-5-12}(a)), the volume of the
resulting tube (or cylindrical shell) can be approximated by cutting
the wall of the tube and laying it out flat~(see
Figure~\ref{fig:5-5-12}(b)) to get a thin, solid rectangular box.

\begin{figure}[!htbp]
\centering
\includegraphics[height=5cm,width=12cm]{graphs/fig5-5-12.eps}
\caption{Shell method for computing a volume of revolution.}
\label{fig:5-5-12}
\end{figure}

The volume of the tube is approximately the same as the volume of the
solid box:
%
\begin{align*}
\text{Vol. tube} \approx \text{Vol. box}
&= \text{length} \times \text{height} \times \text{thickness} \\
&= 2 \pi \times \text{radius} \times \text{height} \times \Delta x_i \\
&= 2 \pi x_i  f(x_i) \Delta x_i.
\end{align*}
%
The volume swept out when the whole region is revolved is the sum of
the volumes of these tubes, i.e. a Riemann sum. The limit of the
Riemann sum is
\[
\text{volume of rotation about the $y$-axis}
=
\int_a^b 2 \pi x f(x) \, dx.
\]

\begin{figure}[!htbp]
\centering
\includegraphics[height=4cm,width=10cm]{graphs/fig5-5-13.eps}
\caption{Shell method for computing a volume of revolution.}
\label{fig:5-5-13}
\end{figure}

\begin{theorem}
\textbf{Volume of revolution using shells.}
If region $R$ is bounded between the functions
$f(x) \geq g(x)$ for $0 \leq a \leq b$~(see Figure~\ref{fig:5-5-13}),
then
\[
\text{volume obtained when $R$ is revolved about the $y$-axis}
=
\int_a^b 2 \pi x \big( f(x) - g(x) \big) \, dx.
\]
\end{theorem}

\begin{example}
Find the volume when the region $R$ in between $x = 2$, $x = 4$,
$y = x$, and $y = x^2$ is revolved about the $y$-axis.
\end{example}

\begin{proof}[Solution]
We can partition the interval $[2, 4]$ on the $x$-axis to get thin
slices of $R$. When the slice at $x_i$ is revolved around the
$y$-axis, a tube is swept out and the volume $V_i$ of this $i$-th tube is
%
\begin{align*}
V_i
&\approx (2\pi \times \text{radius} \times \text{height} \times
         \text{thickness} \\
&\approx 2\pi x_i (x_i^2 - x_i) \Delta x_i \\
&\approx 2\pi (x_i^3 - x_i^2 ) \Delta x_i.
\end{align*}
%
The total approximate volume is the sum of the volumes of the
tubes. As the partition gets finer and finer, we get
\[
V
=
\sum_{\Delta x_i \to 0} V_i
=
\int_2^4 2\pi (x^3 - x^2 ) \, dx
=
2\pi \left.\left( \frac{x^4}{4} - \frac{x^3}{3} \right) \right|^4_2
\]
which simplifies to $2\pi \frac{124}{3} = 259.7\dots$.
\end{proof}


%%-----------------------------------------------------------------------%%
%%--- Problems ----------------------------------------------------------%%

\subsection{Problems}

\begin{enumerate}
\item For the solid in Figure~\ref{fig:5-1-12}, the face formed by a
  cut at $x$ is a triangle with a base of $4$ inches and a height of
  $x^2$ inches. Write and evaluate an integral for the volume of the
  solid for $x$ between $1$ and $2$.

\begin{figure}[!htbp]
\centering
\includegraphics[height=4.5cm,width=7cm]{graphs/fig5-1-12.eps}
\caption{Volume of a solid.}
\label{fig:5-1-12}
\end{figure}

\item Find the volume of the square-based pyramid in
  Figure~\ref{fig:5-1-15}.

\begin{figure}[!htbp]
\centering
\includegraphics[height=4.5cm,width=5.5cm]{graphs/fig5-1-15.eps}
\caption{Volume of a pyramid.}
\label{fig:5-1-15}
\end{figure}

\item Find the volume generated when the region between one arch of
  the sine curve (for $0 \leq x \leq \pi$) and the $x$-axis is revolved
  about (a) the $x$-axis and (b) the line $y = 1/2$.

\item Let $\int_1^5 f(x) \, dx = 4$ and $\int_1^5 f(x)^2 \,dx = 7$.
  Represent the volumes of the solids (a), (b), (c) and (d) in
  Figure~\ref{fig:5-1-25} as definite integrals and evaluate the
  integrals.

\begin{figure}[!htbp]
\centering
\includegraphics[height=8cm,width=8cm]{graphs/fig5-1-25.eps}
\caption{Four volumes.}
\label{fig:5-1-25}
\end{figure}

%% \item Consider Figure~\ref{fig:5-1-37}. For $0 \leq x \leq 3$, each
%%   face is a circle with height (diameter) $4 - x$ meters.

%% \begin{figure}[!htbp]
%% \centering
%% \includegraphics[height=4.5cm,width=7cm]{graphs/fig5-1-37.eps}
%% \caption{Volume with circular cross-sections.}
%% \label{fig:5-1-37}
%% \end{figure}

\item Suppose $A$ and $B$ are solids so that every horizontal cut
  produces faces of $A$ and $B$ that have equal areas. What (if
  anything) can we conclude about the volumes of $A$ and $B$? Justify
  your answer.

\item Calculate the volume of a sphere of radius 2.

\item Let $0 < r < R$ be fixed. Revolve the circle
  $x^2 + (y - R)^2 = r^2$ about the $x$-axis. Compute the volume of
  this ``donut'' solid.

\item
\begin{itemize}
\item[(a)] Find the area between $f(x) = 1/x$ and the $x$-axis for
  $1 \leq x \leq 10$, $1 \leq x \leq 100$, and $1 \leq x \leq A$. What
  is the limit of the area for $1 \leq x \leq A$ as $A \to \infty$? If
  $A = 1000000$ and you think of this area as a long, flat wall,
  estimate the amount of paint (in square feet) you need to paint this
  surface.

\item[(b)] Find the volume swept out when the region in part (a) is
  revolved about the $x$-axis for $1 \leq x \leq 10$,
  $1 \leq x \leq 100$, and $1 \leq x \leq A$. What is the limit of the
  volumes for $1 \leq x \leq A$ as $A \to \infty$? If $A = 1000000$
  and you think of this volume as a room constructed by revolving the
  wall in part (a) about an axis, estimate the amount of paint (in
  cubic feet) you need to completely \emph{fill} the room.

\item[(c)] Which is larger: the amount of paint needed to paint the
  wall or the amount of paint needed to completely fill the room?
\end{itemize}

\item Consider the region between $y = 2x - x^2$ and the $x$-axis for
  $0 \leq x \leq 2$. Sketch the region and calculate the volume swept
  out when the region is revolved about the $y$-axis.

\item Consider the region between $y = \sqrt{1 - x^2}$ and the
  $x$-axis for $0 \leq x \leq 1$. Sketch the region and calculate the
  volume swept out when the region is revolved about the $y$-axis.

\item Consider the region between $y = \frac{1}{1 + x^2}$ and the
  $x$-axis for $0 \leq x \leq 1$. Sketch the region and calculate the
  volume swept out when the region is revolved about the $y$-axis.
\end{enumerate}


%%-----------------------------------------------------------------------%%
%%--- Average values ----------------------------------------------------%%

\section{Average values}
\index{average!by integration}

In this section, we use Riemann sums to extend the familiar notion of
an average. This provides yet another physical interpretation of
integration.

Suppose $y_1, \dots, y_n$ are the amount of rain each day in your
hometown so far this year. The average rainfall per day is
\[
y_{\avg}
=
\frac{y_1 + \cdots + y_n}{n}
=
\frac{1}{n} \sum_{i=1}^n y_i.
\]

\begin{definition}
\label{def:applications:average_value_function}
\textbf{Average value of function.}
Suppose $f$ is a continuous function on an interval $[a, b]$. The
\emph{average value} of $f$ on $[a, b]$ is
\[
f_{\avg}
=
\frac{1}{b - a} \int_a^b f(x) \, dx.
\]
\end{definition}

If we sample $f$ at $n$ points $x_i$, then
\[
f_{\avg} \approx \frac{1}{n} \sum_{i=1}^n f(x_i)
=
\frac{b - a}{n(b - a)} \sum_{i=1}^n f(x_i)
=
\frac{1}{b - a} \sum_{i=1}^n f(x_i) \Delta x_i
\]
since $\ds \Delta x_i = \frac{b - a}{n}$. This is a Riemann sum so
that as $n \to \infty$, then
\[
\frac{1}{b - a} \lim_{n \to \infty} \sum_{i=1}^n f(x_i) \Delta x_i
=
\frac{1}{b-a} \int_a^b f(x) \, dx.
\]
This explains why we defined $f_{\avg}$ as in
Definition~\ref{def:applications:average_value_function}.

\begin{figure}[!htbp]
\centering
\begin{tikzpicture}
[xscale=1.5,%
  yscale=2,%
  linestyle/.style={semithick},%
  axisstyle/.style={semithick,->,>=stealth}]
% horizontal and vertical axes
\draw[axisstyle] (-0.2,0) -- (3.5,0) node[right]{$x$};
\draw[axisstyle] (0,-0.15) -- (0,1.2) node[above]{$y$};
% tick marks on horizontal axis
\draw[linestyle] (1,-0.05) node[below]{1} -- (1,0.05);
\draw[linestyle] (2,-0.05) node[below]{2} -- (2,0.05);
\draw[linestyle] (3,-0.05) node[below]{3} -- (3,0.05);
% tick marks on vertical axis
\draw[linestyle] (-0.05,1) node[left]{1} -- (0.05,1);
% graph of functions
\draw[linestyle] plot[domain=0:3.1415] function{sin(x)};
\end{tikzpicture}
\caption{Plot of $y = \sin(x)$ for $0 \leq x \leq \pi$.}
\label{fig:applications:sin_0_x_pi}
\end{figure}

\begin{example}
\label{ex:applications:average_value_sin}
What is the average value of $\sin(x)$ on the interval $[0, \pi]$?
\end{example}

\begin{proof}[Solution]
Figure~\ref{fig:applications:sin_0_x_pi} shows a plot of $y = \sin(x)$
where $0 \leq x \leq \pi$. Using
Definition~\ref{def:applications:average_value_function}, we get
%
\begin{align*}
\frac{1}{\pi - 0} \int_0^{\pi} \sin(x) \, dx
&= \frac{1}{\pi - 0} \Bigl[-\cos(x)\Bigr]_0^{\pi} \\
&= \frac{1}{\pi} \Bigl[-(-1) - (-1)\Bigr]_0^{\pi}
\end{align*}
%
which simplifies to $2 / \pi$.
\end{proof}

In Definition~\ref{def:applications:average_value_function}, if we
multiply both sides by $(b-a)$, then the average value times the
length of the interval is the area, i.e. the average value gives a
rectangle with the same area as the area under the given function. In
particular, in Figure~\ref{fig:applications:sin_0_x_pi} the area
between the $x$-axis and $\sin(x)$ is exactly the same as the area
between the horizontal line of height $2 / \pi$ and the $x$-axis.

\begin{theorem}
\label{thm:applications:mean_value_theorem}
\textbf{Mean value theorem.}
\index{mean value theorem}
Suppose $f$ is a continuous function on $[a, b]$. Then there is a
number $c \in [a, b]$ such that $f(c) = f_{\avg}$.
\end{theorem}

Theorem~\ref{thm:applications:mean_value_theorem} says that $f$
assumes its average value. It is a used very often in understanding
why certain statements are true. Notice that in
Example~\ref{ex:applications:average_value_sin}, it is just the
assertion that the graphs of the function and the horizontal line
$y = f_{\avg}$ intersect.

\begin{proof}
Let $F(x) = \int_a^x f(t) \, dt$ so that $F'(x) = f(x)$. By the mean
value theorem for derivatives, there is a $c \in [a, b]$ such that
$f(c) = F'(c) = \big( F(b) - F(a) \big) / (b - a)$. But by the
Fundamental Theorem of Calculus
\[
f(c)
=
\frac{F(b) - F(a)}{b - a}
=
\frac{1}{b - a} \int_a^b f(x) \, dx
=
f_{\avg}
\]
as required.
\end{proof}


%%-----------------------------------------------------------------------%%
%%--- Problems ----------------------------------------------------------%%

\subsection{Problems}

In problems 1 to 4, use the values in
Figure~\ref{fig:applications:tabulated_values_f} to estimate the
average values.

\begin{figure}[!htbp]
\centering
\begin{tikzpicture}
[linestyle/.style={semithick},%
  axisstyle/.style={semithick,->,>=stealth}]
% horizontal and vertical axes
\draw[axisstyle] (-0.2,0) -- (6.5,0) node[right]{$x$};
\draw[axisstyle] (0,-0.2) -- (0,3.5) node[above]{$y$};
% tick marks on horizontal axis
\draw[linestyle] (1,-0.1) node[below]{1} -- (1,0.1);
\draw[linestyle] (2,-0.1) node[below]{2} -- (2,0.1);
\draw[linestyle] (3,-0.1) node[below]{3} -- (3,0.1);
\draw[linestyle] (4,-0.1) node[below]{4} -- (4,0.1);
\draw[linestyle] (5,-0.1) node[below]{5} -- (5,0.1);
\draw[linestyle] (6,-0.1) node[below]{6} -- (6,0.1);
% tick marks on vertical axis
\draw[linestyle] (-0.1,1) node[left]{1} -- (0.1,1);
\draw[linestyle] (-0.1,2) node[left]{2} -- (0.1,2);
\draw[linestyle] (-0.1,3) node[left]{3} -- (0.1,3);
% graph of functions
\draw[linestyle] (0,0) -- (2,2) -- (4,2) -- (5,3) -- (6,3);
% dash lines
\draw[linestyle,dash pattern=on 2pt off 2pt] (1,0) -- (1,1);
\draw[linestyle,dash pattern=on 2pt off 2pt] (2,0) -- (2,2);
\draw[linestyle,dash pattern=on 2pt off 2pt] (3,0) -- (3,2);
\draw[linestyle,dash pattern=on 2pt off 2pt] (4,0) -- (4,2);
\draw[linestyle,dash pattern=on 2pt off 2pt] (5,0) -- (5,3);
\draw[linestyle,dash pattern=on 2pt off 2pt] (6,0) -- (6,3);
\draw[linestyle,dash pattern=on 2pt off 2pt] (1,1) -- (6,1);
\draw[linestyle,dash pattern=on 2pt off 2pt] (4,2) -- (6,2);
% labels
\node () at (2.5,2.4) [] {$f(x)$};
\end{tikzpicture}
\caption{Table of values of the function $f(x)$.}
\label{fig:applications:tabulated_values_f}
\end{figure}

\begin{enumerate}
\item Estimate the average value of $f$ on the interval $[0.5, 4.5]$.

\item Estimate the average value of $f$ on the interval $[0.5, 6.5]$.

\item Estimate the average value of $f$ on the interval $[1.5, 3.5]$.

\item Estimate the average value of $f$ on the interval $[3.5, 6.5]$.

\item Find the average value of $\sin(x)$ for $0 \leq x \leq \pi$.

\item Find the average value of $x^2$ for $-1 \leq x \leq 1$.
\end{enumerate}


%%-----------------------------------------------------------------------%%
%%--- Moment and center of mass -----------------------------------------%%

\section{Moment and center of mass}
\index{moment}
\index{center of mass}

This section develops a method for finding the center of mass of a
thin, flat shape---the point at which the shape will balance without
tilting. Centers of mass are important because in many applied
situations an object behaves as though its entire mass is located at
its center of mass. For example, if you are riding in a car with a
high center of mass (such as an SUV) and you make a sudden sharp turn,
you are more likely to tip over than if you are riding in a car with a
low center of mass (such as a sports car). As another example, the
work done to pump the water in a tank to a higher point is the same as
the work to move the center of mass of the water to the higher
point~(see Figure~\ref{fig:5-4-2}), a much easier problem, if we know
the mass and the center of mass of the water. Also, volumes and
surface areas of solids of revolution can be easy to calculate, if we
know the center of mass of the region being revolved.

\begin{figure}[!htbp]
\centering
\includegraphics[height=4.5cm,width=7cm]{graphs/fig5-4-2.eps}
\caption{Work depends on the center of mass.}
\label{fig:5-4-2}
\end{figure}

Before looking for the centers of mass of complicated regions, we
consider point masses and systems of point masses, first in one
dimension and then in two dimensions.


%%-----------------------------------------------------------------------%%
%%--- Point masses ------------------------------------------------------%%

\subsection{Point masses}
\index{point masses}

First we discuss point masses along a line. Two people with different
masses can position themselves on a seesaw so that the seesaw
balances~(see Figure~\ref{fig:5-4-3}). The person on the right causes
the seesaw to ``want to turn'' clockwise about the fulcrum, and the
person on the left causes it to ``want to turn'' counterclockwise. If
these two ``tendencies'' are equal, the seesaw will balance. A measure
of this tendency to turn about the fulcrum is called the \emph{moment}
about the fulcrum of the system, and its magnitude is the mass
multiplied by the distance from fulcrum.

\begin{figure}[!htbp]
\centering
\includegraphics[height=3cm,width=5.5cm]{graphs/fig5-4-3.eps}
\caption{Balance on a seesaw depends on the center of mass.}
\label{fig:5-4-3}
\end{figure}

In general, the moment about the origin $M_0$ produced by a mass $m$
at a location $x$ is $mx$, the product of the mass and the
\emph{signed distance} of the mass from the origin. For a system of
masses $m_1, m_2, \dots, m_n$ at locations $x_1, x_2, \dots, x_n$,
respectively,
\[
M
=
\text{total mass of the system}
=
\sum_{i=1}^n m_i
\]
and
\[
M_0
=
\text{moment about the origin}
=
x_1 m_1 + x_2 m_2 + \cdots + x_n m_n
=
\sum_{i=1}^n x_i m_i.
\]

If the moment about the origin is positive, then the system tends to
rotate clockwise about the origin. If the moment about the origin is
negative, then the system tends to rotate counterclockwise about the
origin. If the moment about the origin is zero, then the system does
not tend to rotate in either direction about the origin; it balances
on a fulcrum at the origin. The moment $M_p$ about the point $p$
produced by a mass $m$ at the location $x$ is the signed distance of
$x$ from $p$ times the mass $m$: $(x - p) \cdot m$. The moment about
the point $p$ produced by masses $m_1, m_2, \dots, m_n$ at locations
$x_1, x_2, \dots, x_n$, respectively, is
\[
M_p
=
\text{moment about $p$}
=
(x_1 - p) m_1 + (x_2 - p) m_2 + \cdots + (x_n - p) m_n
=
\sum_{i=1}^n (x_i - p) m_i.
\]
The point at which the system balances is called the
\emph{center of mass} of the system and is written $\overline{x}$
(pronounced ``$x$ bar''). Since the system balances at $\overline{x}$,
the moment about $p = \overline{x}$ must be zero. Using this fact and
properties of summation, we can find a formula for $\overline{x}$:
\[
0
=
M_{\overline{x}}
=
\sum_{i=1}^n (x_i - \overline{x}) m_i
=
\sum_{i=1}^n x_i m_i - \overline{x} \sum_{i=1}^n m_i
\]
so
\[
\overline{x}
=
\frac{\sum_{i=1}^n x_im_i}{\sum_{i=1}^n m_i}.
\]
This is summarized as follows.

\begin{theorem}
\textbf{Center of mass in one-dimension.}
The center of mass of a system of masses $m_1, m_2, \dots, m_n$
at locations $x_1, x_2, \dots, x_n$ is given by
\[
\overline{x}
=
\frac{\text{moment about the origin}}{\text{total mass}}
=
M_0 / M.
\]
\end{theorem}

Now we discuss point masses in the plane. The ideas of moments and
centers of mass extend nicely from one dimension to a system of masses
located at points in the plane. For a system of masses $m_i$ located
at the points $(x_i, y_i )$,
%
\begin{align*}
M   &= \text{total mass of particles} = \sum_{i=1}^n m_i \\
M_y &= \text{moment about the $y$-axis} = \sum_{i=1}^n m_i x_i \\
M_x &= \text{moment about the $x$-axis} = \sum_{i=1}^n m_i y_i.
\end{align*}

\begin{theorem}
\textbf{Center of mass in two-dimension.}
The center of mass of a system of masses $m_1, m_2, \dots, m_n$
at locations $(x_1, y_1),\, (x_2, y_2), \dots, (x_n, y_n)$ is given by
$(\overline{x},\overline{y})$, where
%
\begin{align*}
\overline{x} =
\frac{\text{moment about the $y$-axis}}{\text{total mass}}
=
M_y / M \\[4pt]
\overline{y}
=
\frac{\text{moment about the $x$-axis}}{\text{total mass}}
=
M_x / M.
\end{align*}
\end{theorem}

\begin{example}
Consider a regular hexagon in the plane centered at the
origin.\footnote{
  To draw this, simply draw a circle and slice it up fairly into 6
  equal ``pie pieces''. The points on the ``crust'' where your slices
  start are the vertices of the hexagon.} Find the center of mass of
the hexagon.
\end{example}

\begin{proof}[Solution]
Suppose that all the vertices of the hexagon have equal mass $1$. The
center of mass of this hexagon is the same as the average value of the
vertices. Therefore, by construction,
$(\overline{x}, \overline{y}) = (0, 0)$.
\end{proof}


%%-----------------------------------------------------------------------%%
%%--- Center of mass of a region in the plane ---------------------------%%

\subsection{Center of mass of a region in the plane}

When we move from discrete point masses to whole, continuous regions
in the plane, we move from finite sums and arithmetic to limits of
Riemann sums, definite integrals, and calculus. The following
discussion extends the ideas and calculations from point masses to
uniformly thin, flat plates that have a constant density given as mass
per area. The center of mass of one of these plates is the point
$(\overline{x}, \overline{y})$ at which the plate balances without
tilting. It turns out that the center of mass
$(\overline{x}, \overline{y})$ of such a plate depends only on the
region of the plane covered by the plate and not on its density. In
this situation, the point $(\overline{x}, \overline{y})$ is also
called the \emph{centroid}\index{centroid} of the region. In the
following discussion, each finite sum that appeared in the discussion
of point masses has a counterpart for these thin plates in terms of
integrals.

The rectangle is the basic shape used to extend the point mass ideas
to regions. The total mass of a rectangular plate is the area of the
plate multiplied by the density constant: mass
$M = \text{area} \times \text{density}$. We assume that the center of
mass of a thin, rectangular plate is located half way up and half way
across the rectangle, at the point where the diagonals of the
rectangle cross. Then the moments of the rectangle can be found by
treating the rectangle as a point with mass $M$ located at the center
of mass of the rectangle.

To find the moments and center of mass of a plate made up of several
rectangular regions, we treat each of the rectangular pieces as a
point mass concentrated at its center of mass. Then the plate is
treated as a system of discrete point masses.

\begin{figure}[!htbp]
\centering
\begin{tikzpicture}
[linestyle/.style={semithick},%
  axisstyle/.style={semithick,->,>=stealth}]
% shaded regions
\filldraw[fill=gray!25,color=gray!25] (0,2) rectangle (2,6);
\filldraw[fill=gray!25,color=gray!25] (2,2) rectangle (4,4);
\draw[linestyle] (0,2) -- (2,2) -- (2,6) -- (0,6);
\draw[linestyle] (2,2) -- (4,2) -- (4,4) -- (2,4);
% dots
\filldraw[fill=black,color=black] (1,4) circle (2pt);
\filldraw[fill=black,color=black] (3,3) circle (2pt);
% horizontal and vertical axes
\draw[axisstyle] (-0.25,0) -- (4.5,0) node[right]{$x$};
\draw[axisstyle] (0,-0.25) -- (0,6.5) node[above]{$y$};
% tick marks on horizontal axis
\draw[linestyle] (1,-0.1) node[below]{1} -- (1,0.1);
\draw[linestyle] (2,-0.1) node[below]{2} -- (2,0.1);
\draw[linestyle] (3,-0.1) node[below]{3} -- (3,0.1);
\draw[linestyle] (4,-0.1) node[below]{4} -- (4,0.1);
% tick marks on vertical axis
\draw[linestyle] (-0.1,1) node[left]{1} -- (0.1,1);
\draw[linestyle] (-0.1,2) node[left]{2} -- (0.1,2);
\draw[linestyle] (-0.1,3) node[left]{3} -- (0.1,3);
\draw[linestyle] (-0.1,4) node[left]{4} -- (0.1,4);
\draw[linestyle] (-0.1,5) node[left]{5} -- (0.1,5);
\draw[linestyle] (-0.1,6) node[left]{6} -- (0.1,6);
% lables
\node () at (3.78,5.5) [] {density};
\node () at (4,5) [] {$= 3~\text{g/cm}^2$};
\end{tikzpicture}
\caption{Centroid of two rectangles.}
\label{fig:applications:centroid_two_rectangles}
\end{figure}

\begin{example}
The plate in Figure~\ref{fig:applications:centroid_two_rectangles} can
be divided into two rectangular plates: one with mass $24$~g and
center of mass $(1, 4)$; and one with mass $12$~g and center of mass
$(3,3)$. Compute the center of mass of the plate.
\end{example}

\begin{proof}[Solution]
The total mass of the pair is $M = 36$~g. The moments about the axes
are $M_x = (24~g)(4~cm) + (12~g)(3~cm) = 132~g~cm$ and
$M_y = (24~g)(1~cm) + (12~g)(3~cm) = 60~g~cm$. Then
$\overline{x} = M_y / M = (60~g~cm) / (36~g) = 5 / 3~cm$ and
$\overline{y} = M_x / M = (132~g~cm) / (36~g) = 11 / 3~cm$ so the
center of mass of the plate is at
$(\overline{x}, \overline{y}) = (5 / 3, 11 / 3)$.
\end{proof}

To find the center of mass of a thin plate, we will ``slice'' the
plate into narrow rectangular plates and treat the collection of
rectangular plates as a system of point masses located at the centers
of mass of the rectangles. The total mass and moments about the axes
for the system of point masses will be Riemann sums. Then by taking
limits as the widths of the rectangles approach $0$, we will obtain
exact values for the mass and moments as definite integrals.


%%-----------------------------------------------------------------------%%
%%--- x bar for a region ------------------------------------------------%%

\subsection{$\overline{x}$ for a region}

Suppose $f(x) \geq g(x)$ on $[a, b]$ and $R$ is a plate on the region
between the graphs of $f$ and $g$ for $a \leq x \leq b$~(see
Figure~\ref{fig:5-4-13}).
%
\begin{figure}[!htbp]
\centering
\includegraphics[height=4cm,width=7cm]{graphs/fig5-4-13.eps}
\caption{Centroid of a region.}
\label{fig:5-4-13}
\end{figure}
%
If the interval $[a, b]$ is partitioned into subintervals
$[x_{i-1}, x_i]$ and the point $c_i$ is the midpoint of each
subinterval, then the slice between vertical cuts at $x_{i-1}$ and
$x_i$ is approximately rectangular and has mass approximately equal to
%
\begin{align*}
\text{area} \times \text{density}
&= \text{height} \times \text{width} \times \text{density} \\
&\approx \big( f(c_i) - g(c_i) \big) (x_{i-1} - x_i) k \\
&= \big( f(c_i) - g(c_i) \big) \Delta x_i k
\end{align*}
where $k$ denotes the density. The mass of the whole plate is
approximately
%
\begin{align*}
M
&= \lim_{\Delta x_i \to 0} \sum_i \big( f(c_i) - g(c_i) \big) \Delta x_i k \\
&= k \int_a^b \big( f(x) - g(x) \big) \, dx \\
&= k \cdot \text{(area of the region between $f$ and $g$)}.
\end{align*}

The moment about the $y$-axis of each rectangular piece is
%
\begin{align*}
M_y
&= \text{(distance from $y$-axis to center of mass of piece)} \times
   \text{mass} \\
&= c_i \big( f(c_i) - g(c_i) \big) \Delta x_i k
\end{align*}
so
\[
M_y
=
\lim_{\Delta x_i \to 0} \sum_i c_i \big( f(c_i) - g(c_i) \big) \Delta x_i k
=
k \int_a^b x \big( f(x) - g(x) \big) \, dx.
\]
The $x$-coordinate of the center of mass of the plate is
%
\[
\overline{x}
=
\frac{M_y}{M}
=
\frac{\int_a^b x \big( f(x) - g(x) \big) \, dx}{\int_a^b f(x) - g(x) \, dx}
\]
since the common factor of $k$ on top and bottom cancel.

\begin{practice}
Find the $x$-coordinate of the center of mass of the region between
$f(x) = x^2$ and the $x$-axis for $0 \leq x \leq 2$. (In this case,
$g(x) = 0$.)
\end{practice}


%%-----------------------------------------------------------------------%%
%%--- y bar for a region ------------------------------------------------%%

\subsection{$\overline{y}$ for a region}

Again, suppose $f(x) \geq g(x)$ on $[a, b]$ and $R$ is a plate on the
region between the graphs of $f$ and $g$ for $a \leq x \leq b$
(see Figure~\ref{fig:5-4-13}).
%
\begin{figure}[!htbp]
\centering
\includegraphics[height=4cm,width=6cm]{graphs/fig5-4-14.eps}
\caption{Finding the $y$-coordinate of the centroid of a region.}
\label{fig:5-4-14}
\end{figure}
%
To find $\overline{y}$, the $y$-coordinate of the center of mass of
the plate $R$, we need to find $M_x$, the moment of the plate about
the $x$-axis. When $R$ is partitioned vertically~(see
Figure~\ref{fig:5-4-14}), the moment $M_x$ of each (very narrow) strip
about the $x$-axis is
\[
\text{(signed distance from $x$-axis to the center of mass of strip)}
\times \text{(mass of strip)}.
\]
Since each thin strip is approximately rectangular, the $y$-coordinate
of the center of mass of each strip is approximately half way up the
strip: $\overline{y}_i \approx \big( f(c_i) + g(c_i) \big) / 2$. Then
%
\begin{align*}
M_x \text{ for the strip}
&= \text{(signed distance from $x$-axis to center of mass of the strip)} \\
&\quad \times \text{(mass of strip)} \\
&= \text{(signed distance from $x$-axis)} \times \text{(height of strip)} \\
&\quad \times \text{(width of strip)} \times \text{(density constant)} \\
&= \frac{f(c_i) + g(c_i)}{2} \big( f(c_i ) - g(c_i) \big) \Delta x_i k.
\end{align*}
%
The moment about the $x$-axis of each rectangular piece is
%
\begin{align*}
& \text{(distance from $x$-axis to center of mass of the piece)} \times
  \text{mass} \\
&= \frac{f(c_i) + g(c_i)}{2} \big( f(c_i) - g(c_i) \big) \Delta x_i k
\end{align*}
%
so
%
\begin{align*}
M_x
&= \lim_{\Delta x_i \to 0}
   \sum_i \frac{f(c_i) + g(c_i)}{2} \big(f(c_i) - g(c_i) \big) \Delta x_i k \\
&= k \int_a^b \frac{f(x) + g(x)}{2} \big( f(x) - g(x) \big) \, dx \\
&= \frac{k}{2} \int_a^b f(x)^2 - g(x)^2 \, dx.
\end{align*}

\begin{practice}
Show that the centroid of a triangular region with vertices $(0, 0)$,
$(0, h)$ and $(b, 0)$ is $(\overline{x}, \overline{y}) = (b/3, h/3)$.
\end{practice}

\begin{example}
Find the centroid of the region bounded between the graphs of $y = x$
and $y = x^2$, for $0 \leq x \leq 1$.
\end{example}

\begin{proof}[Solution]
We have
%
\begin{align*}
M &= k \int_0^1 (x - x^2) \, dx = k / 6 \\
M_y &= k \int_0^1  x(x - x^2) \, dx = k / 12 \\
M_x &= \frac{k}{2} \int_0^1 (x^2 - x^4) \, dx = k / 15.
\end{align*}
%
Then $\overline{x} = M_y / M = 1 / 2$ and
$\overline{y} = M_x / M = 2 / 5$.
\end{proof}


%%-----------------------------------------------------------------------%%
%%--- Theorems of Pappus ------------------------------------------------%%

\subsection{Theorems of Pappus}
\index{Pappus!theorems}

When the location of the center of mass of an object is known, the
theorems of Pappus make some volume and surface area calculations very
easy.

\subsubsection*{Volume of revolution}
\index{volume!of revolution}

If a plane region with area $A$ and centroid
$(\overline{x}, \overline{y})$ is revolved around a line in the plane
which does not go through the region (touching the boundary is
alright), then the volume swept out by one revolution is the area of
the region times the distance traveled by the centroid~(see
Figure~\ref{fig:5-4-31}).

\begin{figure}[!htbp]
\centering
\includegraphics[height=6cm,width=6cm]{graphs/fig5-4-31.eps}
\caption{Pappas' theorem for a volume of revolution.}
\label{fig:5-4-31}
\end{figure}

\begin{theorem}
\textbf{Pappas' theorem for volume.}
\[
\text{Volume about line $L$}
=
A \cdot 2\pi~\text{distance of $(\overline{x}, \overline{y})$ from the line L}.
\]
In particular
\[
\text{Volume about $x$-axis}
=
A \cdot 2 \pi \overline{y}
\]
and
\[
\text{Volume about $y$-axis}
=
A \cdot 2 \pi \overline{x}.
\]
\end{theorem}


\subsubsection*{Surface area of revolution}
\index{surface area!of revolution}

If a plane region with perimeter $P$ and centroid of the edge
$(\overline{x}, \overline{y})$ is revolved around a line in the plane
which does not go through the region (touching the boundary is
alright), then the surface area swept out by one revolution is the
perimeter of the region times the distance traveled by the
centroid~(see Figure~\ref{fig:5-4-32}).

\begin{figure}[!htbp]
\centering
\includegraphics[height=6cm,width=6cm]{graphs/fig5-4-32.eps}
\caption{Pappas' theorem for a surface area of revolution.}
\label{fig:5-4-32}
\end{figure}

\begin{theorem}
\textbf{Pappas' theorem for surface area.}
\[
\text{Surface area about line L}
=
P \cdot 2\pi~\text{distance of $(\overline{x}, \overline{y})$ from the line L}.
\]
In particular
\[
\text{Surface area about $x$-axis}
=
P \cdot 2 \pi \overline{y}
\]
and
\[
\text{Surface area about $y$-axis}
=
P \cdot 2 \pi \overline{x}.
\]
\end{theorem}

\begin{example}
The center of a square region with $2$ foot sides is at the point
$(3, 4)$. Use the theorems of Pappus to find the volume and surface
area swept out when the square is rotated (a)~about the $x$-axis,
(b)~about the $y$-axis, and (c)~about the horizontal line $y = 6$.
\end{example}

\begin{proof}[Solution]
(a) Volume about $x$-axis $= A \cdot 2 \pi \overline{y} = 32\pi$.
Surface area about $x$-axis $= P \cdot 2 \pi \overline{y} = 64 \pi$.

(b) Volume about $y$-axis $= A \cdot 2 \pi \overline{x} = 24 \pi$.
Surface area about $y$-axis $= P \cdot 2 \pi \overline{x} = 48 \pi$.

(c) Volume about the line $y = 6$ is
$A \cdot 2 \pi~\text{(distance of $(3, 4)$ to the line $y=6$)} = 16 \pi$.
Surface area about the line $y = 6$ is
$P \cdot 2 \pi~\text{(distance of $(3, 4 )$ to the line $y=6$)} = 32 \pi$.
\end{proof}


%%-----------------------------------------------------------------------%%
%%--- Arc lengths -------------------------------------------------------%%

\section{Arc lengths}
\index{arc lengths}

This section presents another geometric applications of integration:
finding the length of a curve, i.e. the total distance you travel if
you are moving along a curve. The general strategy is the same as
before. We partition the problem into small pieces, approximate the
solution on each small piece, add the small solutions together in the
form of a Riemann sum, and finally, take the limit of the Riemann sum
to get a definite integral.


%%-----------------------------------------------------------------------%%
%%--- Two-dimensional arc length ----------------------------------------%%

\subsection{Two-dimensional arc length}

Suppose $C$ is a curve and we pick some points $(x_i, y_i)$ along $C$
and connect the points with straight line segments. Then the sum of
the lengths of the line segments will approximate the length of
$C$. We can think of this as pinning a string to the curve at the
selected points and then measuring the length of the string as an
approximation of the length of the curve. Of course, if we only pick a
few points, then the total length approximation will probably be
rather poor, so eventually we want lots of points $(x_i , y_i)$, close
together all along $C$. Suppose the points are labeled so $(x_0, y_0)$
is one endpoint of $C$ and $(x_n, y_n)$ is the other endpoint and that
the subscripts increase as we move along $C$. Then the distance
between the successive points $(x_{i-1}, y_{i-1})$ and $(x_i, y_i)$ is
$\sqrt{(\Delta x_i)^2 + (\Delta y_i)^2}$ and the total length of the
line segments is simply the sum of the successive lengths. This is an
important approximation of the length of $C$ and all of the integral
representations for the length of $C$ come from it. The length of the
curve $C$ is approximately
\[
\sum_i \sqrt{(\Delta x_i)^2 + (\Delta y_i)^2}
=
\sum_i \sqrt{1 + (\Delta y_i / \Delta x_i)^2} \Delta x_i.
\]
This is a Riemann sum. We could have factored out a $\Delta y_i$
instead. The arc length of $C$ is approximately
\[
\sum_i \sqrt{(\Delta x_i)^2 + (\Delta y_i)^2}
=
\sum_i \sqrt{1 + (\Delta x_i/\Delta y_i)^2}\Delta y_i.
\]

\begin{theorem}
\textbf{Arc length in two-dimension.}
The length of the curve $C$ described by the graph of the function
$y = f(x)$, for $a \leq x \leq b$, is given by
\[
\int_a^b \sqrt{1 + f'(x)^2} \, dx.
\]
The length of the curve $C$ described by the graph of the function
$x = g(y)$, for $a \leq y \leq b$, is given by
\[
\int_a^b \sqrt{1 + g'(y)^2} \, dy.
\]
\end{theorem}

\begin{example}
Use the points $(0, 0)$, $(1, 1)$, and $(3, 9)$ to approximate the
length of $y = x^2$, for $0 \leq x \leq 3$.
\end{example}

\begin{proof}[Solution]
The lengths of the pieces are $\sqrt{(1 - 0)^2 + (1 - 0)^2} = \sqrt{2}$
and $\sqrt{(3 - 1)^2 + (9 - 1)^2} = \sqrt{68}$. Then the total length
is approximately $\sqrt{2} + \sqrt{68} = 9.66\dots$ .

We can use \sage to compute some more Riemann sum approximations and
also this arc length exactly:
%
\begin{center}
\fontsize{10pt}{10pt}
\selectfont
\tt
\begin{lstlisting}
sage: f1 = lambda x: sqrt(1 + 4*x^2)
sage: f = Piecewise([[(0, 3), f1]])
sage: n = 10; RR(f.riemann_sum_integral_approximation(n))
8.99946939777166
sage: n = 50; RR(f.riemann_sum_integral_approximation(n))
9.59519771936512
sage: n = 100; RR(f.riemann_sum_integral_approximation(n))
9.67099527976211
sage: n = 200; RR(f.riemann_sum_integral_approximation(n))
9.70900502940468
sage: integral(sqrt(1 + (2*x)^2), x, 0, 3)
3/2*sqrt(37) + 1/4*arcsinh(6)
sage: RR(integral(sqrt(1 + (2*x)^2), x, 0, 3))
9.74708875860856
\end{lstlisting}
\end{center}
%
In other words,
\[
\int_0^3 \sqrt{1 + (2x)^2} \, dx
=
\frac{\sinh^{-1}{6} + 6\sqrt{37}}{4}
=
9.74\dots .
\]
Note that if we reflect this curve about the line $y = x$, then the
resulting part of the curve must have the same arc length. Agreed? Do
you see that the reflected curve is $y = \sqrt{x}$, for $0 \leq x \leq 9$?
In this case, the reflected points are $(0, 0)$, $(1, 1)$, and $(9, 3)$.
The lengths of the reflected pieces are
$\sqrt{(1 - 0)^2 + (1 - 0)^2} = \sqrt{2}$ and
$\sqrt{(9 - 1)^2 + (3 - 1)^2} = \sqrt{68}$, so the total length is
(still) approximately $\sqrt{2} + \sqrt{68} = 9.66\dots$ . The
integral describing the arc length is
\[
\int_0^9 \sqrt{1 + (\frac{1}{2} x^{-1 / 2})^2} \, dx
=
\int_0^9 \sqrt{1 + \frac{1}{4} x^{-1}} \, dx.
\]
This is a harder integral to compute\footnote{
  Of course, there is no need to, since we already know its value!}
but we can use \sage to compute this reflected arc length fairly
accurately:
%
\begin{center}
\fontsize{10pt}{10pt}
\selectfont
\tt
\begin{lstlisting}
sage: f1 = lambda x: sqrt(1 + 1/(4*x))
sage: numerical_integral(f1, 0, 9, max_points=100)
(9.7470886680795221, 7.9546440984616276e-06)
\end{lstlisting}
\end{center}
%
The output is a pair. The first coordinate is the approximate
numerical value of the integral and the second is an upper bound for
the error term. This is in agreement with the above answer.
\end{proof}


\subsubsection*{Parametric equations}

When the curve $C$ is described by pairs $(x, y)$, where $x$ and $y$
are functions of $t$, i.e. $x = x(t)$ and $y = y(t)$ for
$\alpha \leq t \leq \beta$, we can factor $\Delta t_i$ from inside the
radical and simplify:
\[
\sum_i \sqrt{(\Delta x_i)^2 + (\Delta y_i)^2}
=
\sum_i \sqrt{(\Delta x_i / \Delta t_i)^2 +
             (\Delta y_i / \Delta t_i)^2} \Delta t_i.
\]
This is a Riemann sum. Taking limits, we get the following formula.

\begin{theorem}
The length of the curve $C$ described by the graph of the parametric
equations $x = x(t)$ and $y = y(t)$, for $\alpha \leq t \leq \beta$,
is given by
\[
\int_\alpha^\beta \sqrt{x'(t)^2 + y'(t)^2} \, dt.
\]
\end{theorem}

\begin{example}
Represent the length of each curve as a definite integral.
%
\begin{itemize}
\item[(a)] The length of $y = e^x$ between $(0, 1)$ and $(1, e)$.

\item[(b)] The length of the parametric curve $x(t) = \cos(t)$ and
  $y(t) = \sin(t)$ for $0 \leq t \leq 2 \pi$ .
\end{itemize}
\end{example}

\begin{proof}[Solution]
(a) We have $\int_0^1 \sqrt{1 + e^{2x}} \, dx$. This looks complicated
(and it is) but \sage has no problem with it:
%
\begin{center}
\fontsize{10pt}{10pt}
\selectfont
\tt
\begin{lstlisting}
sage: f1 = lambda x: sqrt(1 + exp(2*x))
sage: integral(f1(x), x, 0, 1)
sqrt(e^2 + 1) - sqrt(2) + arcsinh(1) - arcsinh(e^(-1))
sage: RR(integral(f1(x), x, 0, 1))
2.00349711162735
\end{lstlisting}
\end{center}

(b) We have $\int_0^{2\pi} \sqrt{(-\sin(t))^2 + (\cos(t))^2} \, dt
%=\int_0^{2\pi} \sqrt{\sin(t)^2+\cos(t)^2}\, dt
= \int_0^{2\pi} \sqrt{1} \, dt = 2\pi$.
\end{proof}


%%-----------------------------------------------------------------------%%
%%--- Three-dimensional arc length --------------------------------------%%

\subsection{Three-dimensional arc length}

The parametric equation form of arc length extends very nicely to
three dimensions. If a curve $C$ in three-dimension~(see
Figure~\ref{fig:5-2-13}) is given parametrically by $x = x(t)$,
$y = y(t)$, and $z = z(t)$ for $a \leq t \leq b$, then the distance
between the successive points $(x_{i-1}, y_{i-1}, z_{i-1})$ and
$(x_i, y_i, z_i)$ is $\sqrt{\Delta x_i^2 + \Delta y_i^2 + \Delta z_i^2}$.
%
\begin{figure}[!htbp]
\centering
\includegraphics[height=6cm,width=6cm]{graphs/fig5-2-13.eps}
\caption{The arc length of a space curve.}
\label{fig:5-2-13}
\end{figure}
%
We can, as before, factor $(\Delta t_i)^2$ from each term under the
radical, sum the pieces to get a Riemann sum, and take a limit of the
Riemann sum to get a definite integral representing the length of the
curve $C$:
%
\begin{align*}
\lim_{\Delta t_i \to 0}
\sum_i \sqrt{\Delta x_i^2 + \Delta y_i^2 + \Delta z_i^2}
&=
\lim_{\Delta t_i \to 0}
\sum_i \sqrt{(\Delta x_i / \Delta t_i)^2 + (\Delta y_i / \Delta t_i)^2 +
(\Delta z_i / \Delta t_i)^2} \Delta t_i \\
&=
\int_a^b \sqrt{x'(t)^2 + y'(t)^2 + z'(t)^2} \, dt.
\end{align*}

\begin{theorem}
\textbf{Arc length in three-dimension.}
If a curve $C$ in three-dimension is given parametrically by
$x = x(t)$, $y = y(t)$, and $z = z(t)$ for $a \leq t \leq b$, then the
arc length is
\[
\int_a^b \sqrt{x'(t)^2 + y'(t)^2 + z'(t)^2} \, dt.
\]
\end{theorem}

\begin{example}
Find the arc length of the helix $x = \cos(t)$, $y = \sin(t)$, $z = t$ for
$0 \leq t \leq 4\pi$.
\end{example}

\begin{proof}[Solution]
We have
%
\begin{align*}
\int_a^b \sqrt{x'(t)^2 + y'(t)^2 + z'(t)^2} \, dt
&= \int_0^{4\pi} \sqrt{\sin(t)^2 + \cos(t)^2 + 1} \, dt \\
&= \int_0^{4\pi} \sqrt{2} \, dt
\end{align*}
%
which simplifies to $4 \sqrt{2} \pi$.
\end{proof}
